The present invention relates generally to general purpose computers having different address modes, and more specifically to a compiler for enabling transfer of arguments from a calling object program to a called object program even though the programs have been prepared in different address modes.
As is known in the computer art, a source program described in a high-level language such as FORTRAN is translated into a machine language object program by means of a compiler so that it can be executed by a computer system. The source program comprises a main program which performs principle functions of the computer system and subprograms which are invoked, or called by the main program. When machine-language object programs are executed, arguments which indicate numerical and parameter values are transferred from a calling object program (main program) to a called object program (subroutine subprogram) by reference to a parameter list in which the addresses of the arguments are stored. In order to effect such data transfer, the compiler stores the number of arguments and their addresses into the parameter list in accordance with a particular word address mode which is being used at the time a calling object program is generated. The called object program contains instructions at the entry of each subroutine to read arguments from the parameter list according to a particular word address mode of the computer that was being used at the time the called object program was generated.
However, if the word address mode of a called object program differs from the address mode of a calling object program, the arguments referenced during the time the called object program is being generated from a called source program have meaningless values.